package com.esri.core.geometry;

import java.nio.ByteBuffer;

/* loaded from: classes.dex */
public abstract class AttributeStreamBase {
    protected boolean m_bReadonly = false;
    protected boolean m_bLockedInSize = false;

    public abstract void addRange(AttributeStreamBase attributeStreamBase, int i, int i2, boolean z, int i3);

    public abstract int calculateHashImpl(int i, int i2, int i3);

    public abstract boolean equals(AttributeStreamBase attributeStreamBase, int i, int i2);

    public abstract void eraseRange(int i, int i2, int i3);

    public abstract int getPersistence();

    public abstract void insertAttributes(int i, Point point, int i2, int i3);

    public abstract void insertRange(int i, double d, int i2, int i3);

    public abstract void insertRange(int i, AttributeStreamBase attributeStreamBase, int i2, int i3, boolean z, int i4, int i5);

    public abstract double readAsDbl(int i);

    public abstract int readAsInt(int i);

    public abstract long readAsInt64(int i);

    public abstract void readRange(int i, int i2, ByteBuffer byteBuffer, int i3, boolean z);

    public abstract void resize(int i);

    public abstract void resize(int i, double d);

    public abstract void resizePreserveCapacity(int i);

    public abstract AttributeStreamBase restrictedClone(int i);

    public abstract void reverseRange(int i, int i2, int i3);

    public abstract void setRange(double d, int i, int i2);

    public abstract int virtualSize();

    public abstract void writeAsDbl(int i, double d);

    public abstract void writeAsInt(int i, int i2);

    public abstract void writeAsInt64(int i, long j);

    public abstract void writeRange(int i, int i2, AttributeStreamBase attributeStreamBase, int i3, boolean z, int i4);

    public abstract void writeRange(int i, int i2, ByteBuffer byteBuffer, int i3, boolean z);

    public void a(boolean z) {
        if (z) {
            resize(0);
        } else {
            resizePreserveCapacity(0);
        }
    }

    public static AttributeStreamBase createByteStream(int i) {
        return new AttributeStreamOfInt8(i);
    }

    public static AttributeStreamBase createByteStream(int i, byte b) {
        return new AttributeStreamOfInt8(i, b);
    }

    public static AttributeStreamBase createDoubleStream(int i) {
        return new AttributeStreamOfDbl(i);
    }

    public static AttributeStreamBase createDoubleStream(int i, double d) {
        return new AttributeStreamOfDbl(i, d);
    }

    public void setReadonly() {
        this.m_bReadonly = true;
        this.m_bLockedInSize = true;
    }

    public boolean isReadonly() {
        return this.m_bReadonly;
    }

    public void lockSize() {
        this.m_bLockedInSize = true;
    }

    public boolean isLockedSize() {
        return this.m_bLockedInSize;
    }

    public static AttributeStreamBase createAttributeStreamWithPersistence(int i, int i2) {
        if (i != 0) {
            if (i != 1) {
                if (i != 2) {
                    if (i != 3) {
                        if (i != 4) {
                            if (i == 5) {
                                return new AttributeStreamOfInt16(i2);
                            }
                            throw new GeometryException("Internal Error");
                        }
                        return new AttributeStreamOfInt8(i2);
                    }
                    return new AttributeStreamOfInt64(i2);
                }
                return new AttributeStreamOfInt32(i2);
            }
            return new AttributeStreamOfDbl(i2);
        }
        return new AttributeStreamOfFloat(i2);
    }

    public static AttributeStreamBase createAttributeStreamWithPersistence(int i, int i2, double d) {
        if (i != 0) {
            if (i != 1) {
                if (i != 2) {
                    if (i != 3) {
                        if (i != 4) {
                            if (i == 5) {
                                return new AttributeStreamOfInt16(i2, (short) d);
                            }
                            throw new GeometryException("Internal Error");
                        }
                        return new AttributeStreamOfInt8(i2, (byte) d);
                    }
                    return new AttributeStreamOfInt64(i2, (long) d);
                }
                return new AttributeStreamOfInt32(i2, (int) d);
            }
            return new AttributeStreamOfDbl(i2, d);
        }
        return new AttributeStreamOfFloat(i2, (float) d);
    }

    public static AttributeStreamBase createAttributeStreamWithSemantics(int i, int i2) {
        return createAttributeStreamWithPersistence(VertexDescription.getPersistence(i), i2 * VertexDescription.getComponentCount(i), VertexDescription.getDefaultValue(i));
    }

    public static AttributeStreamBase createIndexStream(int i) {
        return new AttributeStreamOfInt32(i);
    }

    public static AttributeStreamBase createIndexStream(int i, int i2) {
        return new AttributeStreamOfInt32(i, i2);
    }
}
